package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysUserMsgMapper;
import com.ruoyi.system.domain.SysUserMsg;
import com.ruoyi.system.service.ISysUserMsgService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户消息Service业务层处理
 * 
 * @author ljx
 * @date 2020-07-11
 */
@Service
public class SysUserMsgServiceImpl implements ISysUserMsgService 
{
    @Autowired
    private SysUserMsgMapper sysUserMsgMapper;

    /**
     * 查询用户消息
     * 
     * @param id 用户消息ID
     * @return 用户消息
     */
    @Override
    public SysUserMsg selectSysUserMsgById(Integer id)
    {
        return sysUserMsgMapper.selectSysUserMsgById(id);
    }

    /**
     * 查询用户消息列表
     * 
     * @param sysUserMsg 用户消息
     * @return 用户消息
     */
    @Override
    public List<SysUserMsg> selectSysUserMsgList(SysUserMsg sysUserMsg)
    {
        return sysUserMsgMapper.selectSysUserMsgList(sysUserMsg);
    }

    /**
     * 新增用户消息
     * 
     * @param sysUserMsg 用户消息
     * @return 结果
     */
    @Override
    public int insertSysUserMsg(SysUserMsg sysUserMsg)
    {
        sysUserMsg.setCreateTime(DateUtils.getNowDate());
        return sysUserMsgMapper.insertSysUserMsg(sysUserMsg);
    }

    /**
     * 修改用户消息
     * 
     * @param sysUserMsg 用户消息
     * @return 结果
     */
    @Override
    public int updateSysUserMsg(SysUserMsg sysUserMsg)
    {
        return sysUserMsgMapper.updateSysUserMsg(sysUserMsg);
    }

    /**
     * 删除用户消息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSysUserMsgByIds(String ids)
    {
        return sysUserMsgMapper.deleteSysUserMsgByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户消息信息
     * 
     * @param id 用户消息ID
     * @return 结果
     */
    @Override
    public int deleteSysUserMsgById(Integer id)
    {
        return sysUserMsgMapper.deleteSysUserMsgById(id);
    }
}
